import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class ApiService {
  private static serverIp = 'localhost';
  private static serverPort = '8081';
  private static apiBase = '/api/v1';

  constructor(protected http: HttpClient) { }

  protected prefixUrlWithBase(url: string): string {
    const serverAddress = `http://${ApiService.serverIp}:${ApiService.serverPort}`;
    return serverAddress + ApiService.apiBase + url;
  }
}
